package db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBConn {
	public static Connection getConn(){
		String DBDIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
		String DBURL = "jdbc:sqlserver://localhost:1433;DatabaseName=student";
		String USERNAME = "sa";
		String PASSWORD = "123456";
		Connection conn = null;
		try {
			Class.forName(DBDIVER);
			conn = DriverManager.getConnection(DBURL,USERNAME,PASSWORD);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		return conn;
	}
}
